#include "wontec_wt184.h"
#include "wontec_485.h"
#include <stdio.h>
#include <string.h>

char wt184_cmds[MAX_184_CMD_NUM] = 
{
    'A',
    'B',
    'b',
    'C',
    'D',
    'd',
    'E',
    'e',
    'G',
    'g',
    'J',
    'j',
    'M',
    'm',
    'N',
    'n',
    'P',
    'p',
    'q',
    'R',
    'r',
    'U',
    'V',
    'v',
    'W',
    'w',
    'X',
    'Y',
    'y',
    '1',
    '2',
    '3',
    '6',
    '7',
    '8',
    '+',
    '-',
    'l'
};

void set_wt184_data(wontec_cmd *pstWtCmd,unsigned char * buffOut, unsigned char* lenOut)
{
    wontec_485_frame frame;
    
    frame.func_code = wt184_cmds[pstWtCmd->func_code];
    frame.slave_addrH = WT184_ADDR_H;
    frame.slave_addrL = WT184_ADDR_L;
    frame.data = pstWtCmd->data;
    frame.dataLen = pstWtCmd->datalen;

    //memset(buffOut,0,MAX_BUFF_LEN);
    printf("func code:%c\n",frame.func_code);

    wontec_frame_serialize(&frame,buffOut,lenOut);
}
